<?php $this->jQuery()->onLoadCaptureStart(); ?>

	jQuery('#submitEmail').click(function() 
				{

					$.ajax({
						url: "sendmail"
					}).done(function() {
					alert("email has been sent!");
					});
				});
<?php $this->jQuery()->onLoadCaptureEnd(); ?>
<div id="content">
	<h1>
		<?php echo $this->pageTitle; ?>
	</h1>
	<h2>
		Entered amount per reasonCode in &euro;
	</h2>
	
	<div id="normaltable">
		<table>
			<thead>
				<tr>
					<th>Customer</th><th>Stock Balance</th><th>Defective</th><th>Miss shipment</th><th>Refusal</th><th>Total</th>
				</tr>
			</thead>
			<tbody>
				<?php 
					foreach($this->amountTable as $row)
					{
						echo '<tr id="'.$row['customerName'].'">';
							echo '<td>'.$row['customerName'].'</td>';
							echo '<td align="right">'.number_format($row['balanceAmount'],2,',','.').' &euro;</td>';
							echo '<td align="right">'.number_format($row['defectiveAmount'],2,',','.').' &euro;</td>';
							echo '<td align="right">'.number_format($row['missshipmentAmount'],2,',','.').' &euro;</td>';
							echo '<td align="right">'.number_format($row['refusalAmount'],2,',','.').' &euro;</td>';
							echo '<td align="right">'.number_format($row['totalAmount'],2,',','.').' &euro;</td>';
						echo '</tr>';
					}
				?>
			</tbody>
			<tr>
				<td colspan="6">
					<h2>
						Entered quantities per Division
					</h2>
				</td>
			</tr>
	
			<thead>
				<tr>
					<th>Customer</th><th>Stock Balance</th><th>Defective</th><th>Miss shipment</th><th>Refusal</th><th>Total</th>
				</tr>
			</thead>
			<tbody>
				<?php 
					foreach($this->quantityTable as $row)
					{
						echo '<tr id="'.$row['divisionDesc'].'">';
							echo '<td>'.$row['divisionDesc'].'</td>';
							echo '<td align="right">'.number_format($row['balanceQty'],0,',','.').'</td>';
							echo '<td align="right">'.number_format($row['defectiveQty'],0,',','.').'</td>';
							echo '<td align="right">'.number_format($row['missshipmentQty'],0,',','.').'</td>';
							echo '<td align="right">'.number_format($row['refusalQty'],0,',','.').'</td>';
							echo '<td align="right">'.number_format($row['totalQty'],0,',','.').'</td>';
						echo '</tr>';
					}
				?>
			</tbody>
		</table>
		<input type="button" name="submitEmail" id="submitEmail" value="Send Email">
	</div>
</div>